﻿using System;
using System.Net;
using System.Windows;
using System.Collections.ObjectModel;
using System.Collections.Generic;

namespace FlowgraphViewer.Model
{
    public class Flowgraph
    {
        /// <summary>
        /// Description of the flowgraph
        /// </summary>
        public string Description { get; set; }

        /// <summary>
        /// Flowgraph group
        /// </summary>
        public string Group { get; set; }

        /// <summary>
        /// Is the flowgraph enabled?
        /// </summary>
        public bool Enabled { get; set; }

        /// <summary>
        /// Flowgraph behaviour in multiplayer
        /// </summary>
        public EFlowgraphMultiplayer Multiplayer { get; set; }

        public ObservableCollection<FlowNodeInstance> Nodes { get; set; }
            
        public ObservableCollection<Edge> Edges { get; set; }


        public Flowgraph()
        {
            Nodes = new ObservableCollection<FlowNodeInstance>();
            Edges = new ObservableCollection<Edge>();
        }




        public FlowNodeInstance GetFlowNodeInstanceById(int id)
        {
            foreach (var node in Nodes)
                if (node.Id == id)
                    return node;

            return null;
        }


    }
}
